<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<link rel="stylesheet" href="http://localhost/LDF/Vmovier/Template/default/css/inc.css" />
	<link rel="stylesheet" href="http://localhost/LDF/Vmovier/Template/default/css/public.css" />
	<!--[if IE 7]>
		<link rel="stylesheet" href="http://localhost/LDF/Vmovier/Template/default/css/ico-ie7.css">
	<![endif]-->
	<script type="text/javascript" src="http://localhost/LDF/Vmovier/Template/default/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="http://localhost/LDF/Vmovier/Template/default/js/public.js"></script>
	<script type="text/javascript" src="http://localhost/LDF/Vmovier/Template/default/js/slide.js"></script>
	<title><?php echo $field['title'];?> - <?php echo $const['webname'];?></title>
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?></head>
<body>
	<!-- 顶部开始 -->
	<div class="bgblack">
		<div class="w1200 auto p5 bgblack">
			<a class="white-2 af mr20" href="http://localhost/LDF/Vmovier">老地方电影</a>
		</div>
	</div>
	<!-- 顶部结束 -->
	<!-- menu开始 -->
	<div class="h65 bgwhite rel zix2 fixMenu">
		<div class="w1200 auto h65 rel fix">
			<div class="logo t0 l0 w100 h65 l mr30"><img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" /></div>
			<ul class="l fm rel menu">
					<li class="l lh60 mr30" act="1"><a class="w50 tc dib f16 black" href="http://localhost/LDF/Vmovier">首页</a></li>
						<?php
		$re = M('category')->limit(5)->where('pid=0')->all();
		foreach ($re as $c) :
			if(0==$c['cid']) $c['act']='act="1"';
			$c['url']=U($c['url'],array('cid'=>$c['cid'],'nav'=>$c['cid']));
		?>
					<li class="l lh60 mr30" <?php echo $c['act'];?>><a class="w50 tc dib f16 black" href="<?php echo $c['url'];?>"><?php echo $c['cname'];?></a></li>
				<?php endforeach ;?>
				<span class="movebg dib w50 bgblue h4 abs b0 l0"></span>
			</ul>
			<div class="r abs t20 r10">
				<form action="<?php echo U('search/index');?>" method="get" class="dib ">
					<div class="dib bdc w200 rel">
						<input class="p5 pct80 bd0" type="text" name="keys" />
						<input type="submit" class="hand gray abs t3 r5 bd0 search" value="&emsp;&ensp;" />
					</div>
				</form>
				<p class="p5 dib fm ml10">
					<?php if($_SESSION['user']['uid']){?>
						<span class="f14 black mr10">欢迎您： <a class="gray a f14" href="<?php echo U('User/index');?>"><i class="icon-user mr3 gray"></i><?php echo $_SESSION['user']['email'];?> [ <?php echo $_SESSION['user']['nickname'];?> ]</a></span>
						<a class="f14 black" href="<?php echo U('User/out');?>"><i class="icon-signout mr3 gray"></i>退出</a>
						<?php if($_SESSION['user']['level'] > 0){?>
							| <a class="f14 blue5 tsblack" href="http://localhost/LDF/Vmovier?a=admin">后台管理</a>
							<?php if($_SESSION['user']['level'] == 9){?><span class="p2 pl5 pr5 rad50 white bgmaroon">超</span><?php }?>
						<?php }?>
					<?php  }else{ ?>
						<a class="f14 black mr10" href="<?php echo U('User/login');?>">登录</a>
						<a class="f14 black" href="<?php echo U('User/reg');?>">注册</a>
					<?php }?>
					
				</p>
			</div>
		</div>
	</div>
	<!-- menu结束 -->



	<!-- 内容开始 -->
	<div class="w1180 auto mt20 fix">
		<!-- 左侧开始 -->
		<div class="f w860 mr20 l">
			<div class="bsd1 bgwhite pt10">
				<div class="lh50 pl20 fm b rel f18">
					<?php echo $field['title'];?>
					<span class="<?php echo $field['styleName'];?>"><?php echo $field['tname'];?></span>
					<!-- 分享开始 -->
					<div class="dib r mt10 mr10">
						<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a title="分享到QQ空间" href="#" class="bds_qzone" data-cmd="qzone"></a><a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina"></a><a title="分享到腾讯微博" href="#" class="bds_tqq" data-cmd="tqq"></a><a title="分享到人人网" href="#" class="bds_renren" data-cmd="renren"></a><a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin"></a></div>
						<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"1","bdMiniList":false,"bdPic":"","bdStyle":"1","bdSize":"24"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
					</div>
					<!-- 分享结束 -->
				 <b class="abs bgblue h50 w5 f0 l-5 t0">1</b></div>
				<div class="gray pl20 rel">
					<span class=""><?php echo $field['uname'];?>&emsp;发布于 <?php echo hd_date($field['addtime'],'Y-m-d H:i:s');?>&emsp;频道：&ensp;</span>
					<a href="<?php echo U('List/index');?>" class="gray"><?php echo $field['cname'];?>&emsp;</a>  
					<span class="dib w90 h14 star f0 dib_vm">
						<b class="dib h14 f0" style="width:<?php echo getStarPct($field['star']);?>%"></b>
					</span>
					<span class="f14 orange"><?php echo $field['star'];?></span>
					<div class="abs r15 t0">
						<i class="icon-eye-open icon-large mr5 gray" title="查看数"></i><?php echo $field['hits'];?> 
						<i class="icon-comment icon-large mr5 gray4 ml5"></i>
						<b class="gray mr5 ml5" id="commentNum"><?php echo $commentTotal;?></b>
						<a href="<?php echo U('Comment/enjoy');?>" class="<?php if($enjoy){?>red<?php  }else{ ?>gray4<?php }?> icon-heart icon-large" onclick="return enjoy(this);"></a>
						<b class="gray mr5 ml5" id="enjoyNum"><?php echo $field['enjoys'];?></b>
					</div>
				</div>
				<div class="p20 fm f16 lh30">
					<?php if($field['videoUrl']){?>
						<object width="100%" height="500"  type="application/x-shockwave-flash" data="<?php echo $field['videoUrl'];?>">
							<param value="<?php echo $field['videoUrl'];?>" name="movie">
							<param name="wmode" value="transparent">
							<param name="allowFullScreen" value="true">
							<param name="allowScriptAccess" value="always">
							<param name="flashvars" value="isAutoPlay=false&quality=high">
							<param name="loop" value="true" />
							<param name="play" value="true" />
							<embed src="<?php echo $field['videoUrl'];?>f"  allowscriptaccess="always" wmode="Opaque" quality="high" allowfullscreen="true" type="application/x-shockwave-flash">
							</embed>
						</object>
					<?php }?>
					<?php echo $field['content'];?>
					<?php if($field['medium']){?>
						<img src="http://localhost/LDF/Vmovier/<?php echo $field['pic'];?>" alt="<?php echo $field['title'];?>" style="max-width:820px;">
					<?php }?>
					<?php if($field['vurl']){?>
						<p class="p10">
							视频地址： <a class="f16" target="_blank" href="<?php echo $field['vurl'];?>"><?php echo $field['vurl'];?></a>
						</p>
					<?php }?>
					<p class="p10">
						老地方电影 <a class="f16" href="<?php echo U('Index/content',array('cid'=>$field['cid'],'aid'=>$field['aid']));?>"><?php echo $field['title'];?></a>评论内容归本站版权所有，转载请注明来自 <a class="f16"  href="http://localhost/LDF/Vmovier">老地方电影（laodifang.com）</a> 
					</p>
					<p class="p10">
						<span class="fs">标签：</span>
						<?php $hd["list"]["t"]["total"]=0;if(isset($field['tags']) && !empty($field['tags'])):$_id_t=0;$_index_t=0;$lastt=min(1000,count($field['tags']));
$hd["list"]["t"]["first"]=true;
$hd["list"]["t"]["last"]=false;
$_total_t=ceil($lastt/1);$hd["list"]["t"]["total"]=$_total_t;
$_data_t = array_slice($field['tags'],0,$lastt);
if(count($_data_t)==0):echo "";
else:
foreach($_data_t as $key=>$t):
if(($_id_t)%1==0):$_id_t++;else:$_id_t++;continue;endif;
$hd["list"]["t"]["index"]=++$_index_t;
if($_index_t>=$_total_t):$hd["list"]["t"]["last"]=true;endif;?>

							<a href="<?php echo U('Search/index',array('keys'=>$t));?>" class="dib gray f14 fs bgwhite-2 blue p2 pl5 pr5 rad2 a1 m5"><?php echo $t;?></a>
						<?php $hd["list"]["t"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
					</p>
				</div>
				<div class="p10 fix">
					<?php if($field['enjoys']){?>
						<a href="" class="af bgred3 f16 dib pt5 pb5 pl10 pr10 white rad3">喜欢 +<?php echo $field['enjoys'];?></a>
					<?php }?>
					
					<!-- 分享开始 -->
					<div class="dib r">
						<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a title="分享到QQ空间" href="#" class="bds_qzone" data-cmd="qzone"></a><a title="分享到新浪微博" href="#" class="bds_tsina" data-cmd="tsina"></a><a title="分享到腾讯微博" href="#" class="bds_tqq" data-cmd="tqq"></a><a title="分享到人人网" href="#" class="bds_renren" data-cmd="renren"></a><a title="分享到微信" href="#" class="bds_weixin" data-cmd="weixin"></a></div>
						<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"1","bdMiniList":false,"bdPic":"","bdStyle":"1","bdSize":"24"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
					</div>
					<!-- 分享结束 -->
				</div>
			</div>
			<!-- 评论区域开始 -->
			<div class="f w860 bsd1 mr20 l bgwhite mt20 pb10 pt10">
				<div class="lh30 pl20 fm b rel f14"><span class="mr10">影片点评</span> <span class="gray1">已有 <b id="commentNumDown"><?php echo $commentTotal;?></b> 条短评</span> <b class="abs bgblue h30 w5 f0 l-5 t0"></b></div>
				<div class="bbd ml20 mr20 mt10 pb10 pl80 rel">
					<div class="abs l0"><a class="dib bdc"> <img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" /></a></div>
					<form action="<?php echo U('Comment/add');?>" method="post" onsubmit="return ajax(this);">
						<input type="hidden" name="aid" value="<?php echo $field['aid'];?>" />
						<textarea class="p5" name="content" id="commcont" cols="140" rows="5"></textarea>
						<p class="p5 tr mt10">
							<span class="gray">还可以发表 <span class="zishu red fg f14 b">2000</span> 字</span>
							<input type="submit" class="btn bgblue" value="发表评论" />
						</p>
					</form>
				</div>
				<div id="commentWrap">
					<!-- 用户评论 -->
					<!-- <div class="bbd ml20 mr20 mt10 pb10 pl80 rel">
						<div class="abs l0"><a class="dib bdc"> <img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" /></a></div>
						<div class="p5">
							<p class="gray p5"><a class="gray f12" href="">老地方</a></p>
							<p class="p5 f14">没有星爷的声音，就不是星爷的电影了。</p>
							<p class="gray p5 f12">2014-5-24 05:05:46</p> -->
							<!-- 用户评论引用 -->
							<!-- <div class="btd ml20 mr20 mt10 pb10 pt10 pl80 rel">
								<div class="abs l0"><a class="dib bdc"> <img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" /></a></div>
								<div class="p5">
									<p class="gray p5"><a class="gray f12" href="">老地方</a></p>
									<p class="p5 f14">没有星爷的声音，就不是星爷的电影了。</p>
									<p class="gray p5 f12">2014-5-24 05:05:46</p>
								</div>
							</div> -->
							<!-- 用户评论引用结束 -->
						<!-- </div>
					</div> -->
					<!-- 用户评论结束 -->
				
					<!-- 用户评论 -->
					<?php $hd["list"]["c"]["total"]=0;if(isset($comment) && !empty($comment)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($comment));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($comment,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

						<div class="bbd ml20 mr20 mt10 pb10 pl80 rel">
							<div class="abs l0">
								<a class="dib bdc">
									<?php if(!$c['pic']){?>
										<img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" />
									<?php  }else{ ?>
										<img src="http://localhost/LDF/Vmovier/<?php echo $c['pic'];?>" width="65" height="65" alt="" />
									<?php }?>
								</a>
							</div>
							<div class="p5">
								<p class="gray p5"><a class="gray f12" href=""><?php echo $c['email'];?> [<?php echo $c['nickname'];?>]</a></p>
								<p class="p5 f14 rel"><?php echo $c['content'];?> <span cid="<?php echo $c['cid'];?>" class="zanComment hand abs r10 t5 gray2"><i class="icon-thumbs-up mr5"></i>赞 <?php echo $c['zan'];?></span> </p>
								<p class="gray p5 f12"><?php echo hd_date($c['addtime'],'Y-m-d H:i:s');?></p>
							</div>
						</div>
					<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
					<!-- 用户评论结束 -->
					<!-- 分页 -->
					<div class="pageAjax page mt10"> <?php echo $page;?> </div>
				</div>
				
				
			</div>
			<!-- 评论区域结束 -->
		</div>
		<!-- 左侧结束 -->
		<!-- 右侧开始 -->
		<div class="f w300 l">

			<!-- <div class="bsd2 bde bgwhite mb20">
				<div class="lh30 pl20 fm b rel mt10">影片作者 <b class="abs bgblue h30 w5 f0 l-5 t0">1</b></div>
				<div class="p10 of">
					<div class="l mr10"><a href=""><img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" /></a></div>
					<div class="l">
						<p class="gray-3 pb10 f14">松岩 <span class="ml10 orange2 f18 fg">V</span></p>
						<p class="gray">影视爱好者</p>
						<p class="gray">片中职务: 剪辑</p>
					</div>
				</div>
			</div> -->

			<div class="bsd2 bde bgwhite">
				<div class="lh30 pl20 fm b rel mt10">热门排行 <b class="abs bgblue h30 w5 f0 l-5 t0">1</b> </div>
				<div class="p10">
							<?php
		$re = 0?M('article')->limit(4)->where('cid=0')->order('aid DESC')->all():M('article')->limit(4)->order('aid DESC')->all();
		foreach ($re as $a) :
			$a['urls']=U('Index/content',array('cid'=>$a['cid'],'aid'=>$a['aid'],'nav'=>$a['cid']));
		?>
						<p class="p5 mr0 dib w120 h80 mt5 rel">
							<a href="<?php echo $a['urls'];?>" class="">
								<?php if($a['small']){?>
									<img width="120" height="80" src="http://localhost/LDF/Vmovier/<?php echo $a['small'];?>" alt="" />
								<?php  }else{ ?>
									<img width="120" height="80" src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" />
								<?php }?>
								
								<span class="abs white b3 r5 fm"><?php echo hd_date($a['addtime'],'i:s');?></span>
							</a>
							<a href="<?php echo $a['urls'];?>" class="f14 gray-5 fm"><?php echo mb_substr($a['title'],0,8,'utf8');?></a>
						</p>
					<?php endforeach ;?>
					
					
					
					<p class="p5 fm mt10 tr"><a href="" class="f14">推荐影片给我们></a></p>
				</div>
			</div>
			<div class="bsd2 bde mt20 bgwhite">
				<div class="lh30 pl20 fm b rel mt10">热门活动 <b class="abs bgblue h30 w5 f0 l-5 t0">1</b> <a href="" class="abs r10 t0 n fs black">更多活动+</a></div>
				<div class="p10">
							<?php
		$re = 16?M('article')->limit(10)->where('cid=16')->order('aid DESC')->all():M('article')->limit(10)->order('aid DESC')->all();
		foreach ($re as $a) :
			$a['urls']=U('Index/content',array('cid'=>$a['cid'],'aid'=>$a['aid'],'nav'=>$a['cid']));
		?>
						<a href="<?php echo $a['urls'];?>" class="p10 dib"><img class="w260 h120" src="http://localhost/LDF/Vmovier/<?php echo $a['medium'];?>" alt="" /></a>
					<?php endforeach ;?>
				</div>
			</div>
		</div>
		<!-- 右侧结束 -->
	</div>
	<!-- 内容结束 -->


<!-- 登陆区域 -->
<div id="Login" class="dn">
	<div class="w600 fm mt20">
		<form action="<?php echo U('User/login');?>" method="post" onsubmit="return loginAjax(this);">
			<p class="p10 fix">
				<span class="w100 dib mr15 tr f14">常用邮箱</span>
				<input name="email" type="text" class="pct50 p5 f14" />
			</p>
			<p class="p10 fix mt20">
				<span class="w100 dib mr15 tr f14">密码</span>
				<input name="pwd" type="password" class="pct50 p5 f14" />
			</p>
			<p class="p10 fix mt20">
				<span class="w100 dib mr15 tr f14"></span>
				<label for="au">
					<input name="auto" type="checkbox" id="au" class="" checked="" /> 下次自动登陆
				</label>
				<!-- <a href="" class="ml30 pl30">忘记密码了</a> -->
			</p>
			<p class="p10 fix f18 mt20">
				<span class="w100 dib mr15 tr f14"></span>
				<input type="submit" class="btn bgblue pct50" value="登 陆" />
			</p>
			<p class="p10 fix mt20">
				<span class="w100 dib mr30 tr f14"></span>
				<span class=" dib tr f14">
					还没有账号？ <a href="<?php echo U('User/reg');?>">立即注册</a>
				</span>
			</p>
		</form>
	</div>
</div>
<!-- 登陆区域结束 -->




<script type="text/javascript">
	var sessionUid = '<?php echo $_SESSION['user']['uid'];?>';
	var sessionEmail = '<?php echo $_SESSION['user']['email'];?>';
	var sessionNickName = '<?php echo $_SESSION['user']['nickname'];?>';
	var loginHtml = $('#Login').clone();
	function ajax(id){ //发表评论
		var url = $(id).attr('action'),
			cont = $(id).find('[name=content]'),
			warp = $('#commentWrap');
		$.post(url,$(id).serialize(),function(re){
			if(re.state){
				h='\
				<div class="bbd ml20 mr20 mt10 pb10 pl80 rel">\
					<div class="abs l0"><a class="dib bdc"> <img src="http://localhost/LDF/Vmovier/Template/default/img/logo.png" alt="" /></a></div>\
					<div class="p5">\
						<p class="gray p5"><a class="gray f12" href="">'+sessionEmail+' ['+sessionNickName+']</a></p>\
						<p class="p5 f14">'+re.data.content+'</p>\
						<p class="gray p5 f12">'+re.data.addtime+'</p>\
					</div>\
				</div>\
				';
				$.msg({
					str:re.msg,
					close:function(){
						cont.focus();
					}
				})
				cont.val('');
				warp.prepend(h);
				var n = Number($('#commentNum').text())+1;
				var dn = Number($('#commentNumDown').text())+1;
				$('#commentNum').text(n);
				$('#commentNumDown').text(dn);
			}else{
				alert(re.msg);
			}
		},'json')
		return false;
	}
	//喜欢+1
	function enjoy(id){
		if(checkLogin()){
			var url = $(id).attr('href'),cl = $(id).hasClass('red')?1:0,
			aid = "<?php echo $field['aid'];?>";
			$(id).toggleClass('gray4').toggleClass('red');
			$.post(url,{aid:aid,cl:cl},function(re){
				if(re==1){
					$.msg({ str:' <b class="white bggreen p5 rad5">:)</b> 喜欢+1'});
					var n = Number($('#enjoyNum').text())+1;
					$('#enjoyNum').text(n);
				}else{
					$.msg({ str:' <b class="white bggray p5 rad5">:(</b> 喜欢-1'});
					var n = Number($('#enjoyNum').text())-1;
					$('#enjoyNum').text(n);
				}
				
			})
		}
		return false;
	}

	$('#commcont').click(function(){
		checkLogin();
	})

	//评论 赞  功能
	$('.zanComment').click(function(){
		var cid=$(this).attr('cid'),
			url='<?php echo U("Comment/zan");?>';
			$.post(url,{cid:cid},function(re){
				if(re) $.msg({str:'已赞!'});
			})
	})
	
</script>


	<!-- 底部开始 -->
	<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?>	<!-- 底部开始 -->
	<div class="bgblack h100 white-2 mt20">
		<!-- <div class="fs tc pt10">
			<a href="" class="dib p5 white-2">合作推广</a>
			<a href="" class="dib p5 white-2">联系我们</a>
			<a href="" class="dib p5 white-2">加入我们</a>
		</div> -->
		<div class="pt20">
			<p class="tc p5"><?php echo $const['bottom1'];?></p>
			<p class="tc p5"><?php echo $const['bottom2'];?></p>
		</div>
	</div>
	<!-- 底部结束 -->
</body>
</html>
	<!-- 底部结束 -->
